package com.jiulan.hearthearing.ui.my.adapter;

import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jiulan.hearthearing.R;

import java.util.List;

public class PersonInfoAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
    private String choose = "";

    //进入单选页面执行这个方法，选中传过来的ID对应的item
    public void setClickPosition(String choose) {
        this.choose = choose;
    }

    public PersonInfoAdapter(List<String> data) {
        super(R.layout.item_my_person_info, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        ImageView ivSelect = helper.getView(R.id.ivSelect);
        helper.setText(R.id.tvTab, item);
        if (choose.equals(item)) {
            ivSelect.setVisibility(View.VISIBLE);
        } else {
            ivSelect.setVisibility(View.GONE);
        }
    }
}
